
#ifndef AboutBox_H_
#define AboutBox_H_

#include <wx/dialog.h>
#include <wx/gbsizer.h>
#include <wx/statbmp.h>
#include <wx/stattext.h>
#include <wx/statline.h>

/** @class AboutBox
    Displays "About" information for an applicatio.

    AboutBox is based on wxMozillaLikeAboutBoxDialog by Volodymir (T-Rex)
    Tryapichko (http://wxwidgets.info/how-to-create-nice-about-box-in-wxwidgets).
*/
class AboutBox : public wxDialog
{
    DECLARE_DYNAMIC_CLASS( AboutBox )
    DECLARE_EVENT_TABLE()

public:
    /** Constructor */
    AboutBox(void);
    /** Constructor */
    AboutBox( wxWindow* parent, wxWindowID id = ID_ABOUTBOX,
        const wxString& title = wxT( "About" ),
        const wxPoint& pos = wxDefaultPosition,
        const wxSize& size = wxDefaultSize,
        long style = wxDEFAULT_DIALOG_STYLE,
        const wxString& name = wxT( "AboutBox" ) );

    /** Destructor */
    ~AboutBox(void);

    /** Create the window */
    bool Create( wxWindow* parent, wxWindowID id = ID_ABOUTBOX,
        const wxString& title = wxT( "About" ),
        const wxPoint& pos = wxDefaultPosition,
        const wxSize& size = wxDefaultSize,
        long style = wxDEFAULT_DIALOG_STYLE,
        const wxString& name = wxT( "AboutBox" ) );

    /** Initialize the window */
    void Init();

    /** Create the controls in the window (populate the window) */
    void CreateControls();

    /** Return the application name */
    wxString GetAppName() const;
    /** Set the application name */
    void SetAppName( const wxString& name );

    /** Get the version string */
    wxString GetVersion() const;
    /** Set the version string */
    void SetVersion( const wxString& version );

    /** Get the copyright string */
    wxString GetCopyright() const;
    /** Set the copyright string */
    void SetCopyright( const wxString& copy );

    /** Get custom build information */
    wxString GetCustomBuildInfo() const;
    /** Set the custom build information */
    void SetCustomBuildInfo( const wxString& info );

    enum wxBuildInfoFormat
    {
        wxBUILDINFO_SHORT,
        wxBUILDINFO_LONG
    };

    /** Get the specified build info */
    static wxString GetBuildInfo( wxBuildInfoFormat format );

    /** Set the header bitmap */
    void SetHeaderBitmap( const wxBitmap& value );
    /** Set the header bitmap from an external file */
    void SetHeaderBitmap( const wxString& name );
    /** Apply the settings */
    void ApplyInfo();

private:
    wxPanel*        mContentPanel;
    wxStaticBitmap* mHeaderBitmap;
    wxStaticText*   mAppNameText;
    wxStaticText*   mCopyrightText;
    wxStaticText*   mVersionText;
    wxStaticText*   mBuildInfoText;
    wxString        mAppName;
    wxString        mVersion;
    wxString        mCopyright;
    wxString        mCustomBuildInfo;

    enum {
        ID_ABOUTBOX = 10000,
        ID_CONTENT_PANEL = 10001
    };
};

//wxBitmap wxGetBitmapFromMemory( const void* data, size_t length );

#endif  // AboutBox_H_
